package main.java.tmi.productAdjust.service.impl;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import main.java.tmi.common.service.impl.AbstractDao;
import main.java.tmi.productAdjust.service.ProductAdjustVO;

import org.springframework.stereotype.Repository;

/**
 * ProductAdjust Data Access Object (cust Table)
 *
 * @author min™
 * @since 2012. 04. 24
 */
@Repository
public class ProductAdjustDAO extends AbstractDao {
	
	/**
	 * ProductAdjust search
	 * @return List<ProductAdjustVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public List<ProductAdjustVO> getProductAdjustView(Map<String,String> param) throws SQLException {
				
		return (List<ProductAdjustVO>) list("ProductAdjustDAO.getProductAdjustView", param);
	}
	
	/**
	 * ProductAdjust search
	 * @return List<ProductAdjustVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public int getProductAdjustViewCount(Map<String,String> param) throws SQLException {
		return Integer.parseInt((String) getSqlMapClientTemplate().queryForObject("ProductAdjustDAO.getProductAdjustViewCount", param));
	}
	
	/**
	 * ProductAdjust search
	 * @return List<ProductAdjustVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public Map<String,String>  getProductAdjustDetailView(Map<String,String> param) throws SQLException {
		Map<String,String> returnMap ;
        returnMap = (Map<String,String>) selectByPk("ProductAdjustDAO.getProductAdjustDetailView", param);
        
        return returnMap;
	}
	
	/**
	 * ProductAdjust save
	 * @return void
	 * @throws SQLException 
	 */
	public void addProductAdjust(Map<String,String> param) throws SQLException {
		insert("ProductAdjustDAO.addProductAdjust", param);
	}
	
	/**
	 * ProductAdjust modify
	 * @return void
	 * @throws SQLException 
	 */
	public void modifyProductAdjust(Map<String,String> param) throws SQLException {
		insert("ProductAdjustDAO.modifyProductAdjust", param);
	}
	
	
	/**
	 * productAdjustDupChk
	 * @return void
	 * @throws SQLException 
	 */
	public String productAdjustDupChk(Map<String,String> param) throws SQLException {
		String productSeq = selectByPk("ProductAdjustDAO.productAdjustDupChk", param).toString(); 
		return productSeq;
	}
	
	/**
	 * ProductAdjust del
	 * @return void
	 * @throws SQLException 
	 */
	public void delProductAdjust(Map<String,String> param) throws SQLException {
		insert("ProductAdjustDAO.delProductAdjust", param);
	}	
}
